import { http } from '@/utils/http/axios';

/**
 * @description: 查询角色详细
 */
export function getAllRole(data = {}) {
  return http.request({
    url: '/admin/sys/role/list',
    method: 'get',
    data,
  });
}

/**
 * @description: 查询角色列表
 */
export function listRole(data = {}) {
  return http.request({
    url: '/admin/sys/role/page',
    method: 'post',
    data,
  });
}

/**
 * @description: 新增角色
 */
export function addRole(data = {}) {
  return http.request({
    url: '/admin/sys/role/add',
    method: 'post',
    data,
  });
}

/**
 * @description: 修改角色
 */
export function updateRole(data) {
  return http.request({
    url: '/admin/sys/role/update',
    method: 'post',
    data,
  });
}

// 删除角色
export function delRole(idList) {
  return http.request({
    url: '/admin/sys/role/delete',
    method: 'post',
    data: idList,
  });
}

// 角色
export function infoRole(id) {
  return http.request({
    url: '/admin/sys/role/info',
    method: 'post',
    data: {
      id,
    },
  });
}
